@extends('admin.layout.base')
@section('title', '编辑表单页面')
@section('content')
<div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            管理员添加表单     
        </h1>       
        <ol class="breadcrumb">
            <li><a href="{{ url('/admin') }}"><i class="fa fa-dashboard"></i> 首页</a></li>
            <li><a href="{{ url('/admin/admin') }}">管理员管理</a></li>
            <li class="active">添加管理员</li>
        </ol>
    </section>

    <!-- Main content -->
    <section class="content">
        <div class="row">
            <!-- left column -->
            <div class="col-md-12">
                <!-- general form elements -->
                <div class="box box-primary">
                    <div class="box-header with-border">
<!--                        <h3 class="box-title">Quick Example</h3>-->
                    </div>
                    <!-- /.box-header -->
                    <!-- form start -->
                    <form role="form" method="post" action="{{ url("/admin/admin/store") }}" class="form-horizontal">
                        <input type="hidden" name="_token" value="{{ csrf_token() }}">
                        <div class="box-body">
                            <div class="form-group">
                                <label for="admin_name" class="col-sm-2 control-label">管理员名称</label>
                                <div class="col-sm-5">
                                    <input type="text" name="admin_name" class="form-control" id="admin_name" placeholder="请输入姓名">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="admin_nickname" class="col-sm-2 control-label">管理员昵称</label>
                                <div class="col-sm-5">
                                    <input type="text" name="admin_nickname" class="form-control" id="admin_nickname" placeholder="请输入昵称">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="admin_pass" class="col-sm-2 control-label">管理员密码</label>
                                <div class="col-sm-5">
                                    <input type="password" name="admin_pass" class="form-control" id="admin_pass" placeholder="请输入密码">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="admin_groupid" class="col-sm-2 control-label">管理员分组</label>
                                <div class="col-sm-5">
                                    <select name="admin_groupid" class="form-control">
                                        @foreach ($groups as $group)
                                        <option value="{{$group->id}}">{{$group->title}}</option>
                                        @endforeach
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="admin_email" class="col-sm-2 control-label">管理员邮箱</label>
                                <div class="col-sm-5">
                                    <input type="email" name="admin_email" class="form-control" id="admin_email" placeholder="请输入邮箱">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="admin_avartar" class="col-sm-2 control-label">上传头像</label>
                                <div class="col-sm-5">
                                    <input type="file" id="admin_avartar">
                                </div>
                            </div>
                            <div class="box-footer">
                                <button type="submit" class="btn btn-primary" class="btn btn-info" />添 加</button>
                            </div>
                        </div>
                        <!-- /.box-body -->     
                    </form>
                </div>
            </div>
            {{ session("info") }}
            <!--{{ dump($errors->all()) }}-->
            <ul>
            @if (count($errors) > 0)
                @foreach ($errors->all() as $error)
                <li>{{ $error }}</li> 
                @endforeach
            @endif 
            </ul>
        </div>
    </section>
    <!-- /.content -->
</div>
@endsection
@section('pluginscript')
<!-- FastClick -->
<script src="{{ asset('/dist/admin/plugins/fastclick/fastclick.js') }}"></script>
@endsection

